﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


    public class Point
    {
        public int X { get; set; }
        public int Y { get; set; }

        public Point(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }

        public static int CalculateCrossProduct(Point pivotPoint, Point firstPoint, 
            Point secondPoint)
        {
            int x1 = pivotPoint.X;
            int y1 = pivotPoint.Y;
            int x2 = firstPoint.X;
            int y2 = firstPoint.Y;
            int x3 = secondPoint.X;
            int y3 = secondPoint.Y;

            int crossProduct = (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1);
            //int crossProduct = (x1 * (y2-y3)) + (x2 * (y3 - y1)) + (x3 * (y1-y2));
            return crossProduct;
        }

        public override string ToString()
        {
            return String.Format("({0}, {1})", this.X, this.Y);
        }
    }

